package org.yawnage.framework.server 
{
	import org.yawnage.base.BaseClass;
	import org.yawnage.interfaces.base.IMapperObject;
	import org.yawnage.interfaces.framework.ISubscriber;
	 /**
	  * <p>//TODO:To be written</p>
	  * @author Berry Jordaan
	  * @date 2011/09/06 12:33 PM
	  * @copyright  Copyright © Berry/James 2011
	  * @version 1.0.0.0
	  * @filename Bridge.as 
	  * @description
	  * @history Berry Jordaan on 2011/09/06 12:33 PM: Created
	  */
	public class SubscriberObject extends BaseClass implements IMapperObject
	{
		
		//************** Enums **************

		//************** Public *************
		
		//************** Private ************
		private var _subscriberP	:ISubscriber;
		private var _methodP		:Function;
		private var _id				:int;
		private var _priority		:int;
		private var _key			:String;
		
		//************** protected **********
		
		/**
		 * Constructor
		 */
		public function SubscriberObject(subscriberP:ISubscriber, methodP:Function, id:int, priority:int = 0)
		{
			super();
			setClassDescription("org.yawnage.framework.server.SubscriberObject");
			_priority 			= priority;
			_id 				= id;
			_methodP	 		= methodP;
			_subscriberP	 	= subscriberP;
		}
		
		/**
		 * useless comment here!
		 */
		override public function dispose():void 
		{
			super.dispose();
		}
		
		/* INTERFACE org.yawnage.base.interfaces.IMapperObject */
		
		public function get key():String 
		{
			return _id.toString();
		}
		
		public function get subscriber():ISubscriber 
		{
			return _subscriberP;
		}
		
		public function get method():Function 
		{
			return _methodP;
		}
		
		public function get id():int 
		{
			return _id;
		}
		
		public function get priority():int 
		{
			return _priority;
		}
		
	}
}